/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package local;

import entity.CartoesMb;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Emanuel
 */
@Stateless
public class CartoesMbFacade implements CartoesMbFacadeLocal {
    @PersistenceContext
    private EntityManager em;

    public void create(CartoesMb cartoesMb) {
        em.persist(cartoesMb);
    }

    public void edit(CartoesMb cartoesMb) {
        em.merge(cartoesMb);
    }

    public void remove(CartoesMb cartoesMb) {
        em.remove(em.merge(cartoesMb));
    }

    public CartoesMb find(Object id) {
        return em.find(CartoesMb.class, id);
    }

    public List<CartoesMb> findAll() {
        return em.createQuery("select object(o) from CartoesMb as o").getResultList();
    }

}
